﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


using MBSPL.UserControls.CinemaUserControl ;

namespace MBSPL
{
    public partial class _Default : System.Web.UI.Page
    {

        #region Copy
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                CinemaList1.LoadDropDownBox();
                Label1.Text = AddCinemaUserControl1.Actionresult.ToString();

            }

                AddCinemaUserControl1.CinemaAddComplete += new AddCinemaUserControl.CinemaAddHandler(AddCinemaUserControl1_CinemaAddComplete);
                AddCinemaUserControl1.CinemaAddFailed += new AddCinemaUserControl.CinemaAddHandler(AddCinemaUserControl1_CinemaAddFailed);

                CinemaList1.CimeListChanged += new CinemaList.CinemaListHandler(CinemaList1_CimeListChanged);

                
                RemoveCinemaUserControl1.RemoveCinemaSuccesull += new RemoveCinemaUserControl.RemoveCinemaHandler(RemoveCinemaUserControl1_RemoveCinemaSuccesull);
                RemoveCinemaUserControl1.RemoveCinemaFailed += new RemoveCinemaUserControl.RemoveCinemaHandler(RemoveCinemaUserControl1_RemoveCinemaFailed);    
         }

        void RemoveCinemaUserControl1_RemoveCinemaFailed()
        {
            Label3.Text = "Movie Deletion Failed";
        }

        void RemoveCinemaUserControl1_RemoveCinemaSuccesull()
        {
            Label3.Text = "Movie Deleted Successffully";
        }

        void CinemaList1_CimeListChanged(int SelectedValue)
        {
            Label2.Text = SelectedValue.ToString();
        }

        void AddCinemaUserControl1_CinemaAddFailed()
        {
            Label1.Text = AddCinemaUserControl1.Actionresult.ToString() + "Cinema Added Failed";
        }

        private void AddCinemaUserControl1_CinemaAddComplete()
        {
            
            Label1.Text = AddCinemaUserControl1.Actionresult.ToString()+"Cinema Added Successfully";
            CinemaList1.LoadDropDownBox();
        }


        #endregion
    }


}
